<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>百叶窗</title>
  <style>
    body{
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100vh;
      overflow: hidden;
      margin: 0;
      background-color: pink;

    }
    .container{
      display: flex;
      width: 90vw;
    }
    .panel{
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      height: 80vh;
      border-radius: 50px;
      margin: 10px;
      flex:0.5;
      transition: all 700ms ease;
      cursor: pointer;
    }
    .panel.active{
      flex:5;
    }
    @media(max-width:680px){
      .container{
        width: 100vw;
      }
      .panel:nth-of-type(4),
      .panel:nth-of-type(5){
        display: none;
      }
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="panel active" style="background-image: url('./imgs/not1.jpg')"></div>
    <div class="panel active" style="background-image: url('./imgs/not2.jpg')"></div>
    <div class="panel active" style="background-image: url('./imgs/not4.jpg')"></div>
    <div class="panel active" style="background-image: url('./imgs/not5.jpg')"></div>
    <div class="panel active" style="background-image: url('./imgs/not3.png')"></div>
  </div>
  <script>
    const panel = document.querySelectorAll('.panel');
    panel.forEach((panel) => {
      panel.onclick = () => {
        removeActiveClasses()
        panel.classList.add('active')
      }
    })
    function removeActiveClasses(){
      panel.forEach((panel) => {
        panel.classList.remove('active')
      })
    }
  </script>
</body>
</html>